package com.example.myblog1_0.mapper;

import com.example.myblog1_0.model.LeaveMessage;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Author: xc
 * @Date: 2018/12/22 14:14
 * @Description:
 **/
@Mapper
@Repository
public interface LeaveMessageMapper {
    @Insert("insert into leavemessage(username,message,sendTime,userAvatarUrl) values(#{username},#{message},#{sendTime},#{userAvatarUrl})")
    boolean saveMessage(LeaveMessage leaveMessage);
    @Select("select * from leavemessage order by id desc")
    List<LeaveMessage> findAllMessage();
}
